<template lang="">
  <div>
      <table border="1" contenteditable="0">
          <tr>
              <td>商品名称</td>
              <td>商品介绍</td>
          </tr>
          <tr>
              <td>{{list.title}}</td>
              <td>{{list.content}}</td>
          </tr>
      </table>
      <van-field label="请输入评价" v-model="title"/>
      <van-button @click="postlist">添加</van-button>
  </div>
</template>

<script>
export default {
    data(){
        return{
            id:this.$route.query.id,
            list:{},
            title:''
        }
    },
    methods:{
        add(){
            this.axios.get('appraise?id='+this.id).then(res=>{
                this.list = res.data.list
            })
        },
        postlist(){
            this.axios.post('appraise',{'title':this.title,'good_id':this.id}).then(res=>{
                if(res.data.code==200){
                    alert('添加成功')
                    this.title = ''
                }
            })
        }
    },
    mounted(){
        this.add()
    }
}
</script>

<style>

</style>